using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;

namespace UwinEducation.Shared.Models
{
    /// <summary>
    /// 分页请求参数
    /// </summary>
    public class PageRequest
    {
        private int _pageIndex = 1;
        private int _pageSize = 10;

        /// <summary>
        /// 页码（从1开始）
        /// </summary>
        public int PageIndex
        {
            get => _pageIndex;
            set => _pageIndex = value < 1 ? 1 : value;
        }

        /// <summary>
        /// 每页记录数
        /// </summary>
        public int PageSize
        {
            get => _pageSize;
            set => _pageSize = value < 1 ? 10 : value;
        }

        /// <summary>
        /// 搜索关键字
        /// </summary>
        public string? Search { get; set; }

        /// <summary>
        /// 排序字段
        /// </summary>

        public string? SortField { get; set; }

        /// <summary>
        /// 排序方式（asc/desc）
        /// </summary>
        public string? SortOrder { get; set; }
    }

    ///// <summary>
    ///// 用户分页请求参数
    ///// </summary>
    //public class UserPageRequest : PageRequest
    //{
    //    /// <summary>
    //    /// 用户名
    //    /// </summary>
    //    public string? UserName { get; set; }
    //    /// <summary>
    //    /// 真实姓名
    //    /// </summary>
    //    public string? RealName { get; set; }
    //    /// <summary>
    //    /// 手机号
    //    /// </summary>
    //    public string? PhoneNumber { get; set; }
    //    /// <summary>
    //    /// 邮箱
    //    /// </summary>
    //    public string? Email { get; set; }
    //}
    ///// <summary>
    ///// 教室分页请求参数
    ///// </summary>
    //public class ClassroomPageRequest : PageRequest
    //{
    //    /// <summary>
    //    /// 教室名称
    //    /// </summary>
    //    public string? Name { get; set; }
    //    /// <summary>
    //    /// 备注
    //    /// </summary>
    //    public string? Remarks { get; set; }
    //}
    ///// <summary>
    ///// 课程分页请求参数
    ///// </summary>
    //public class CoursePageRequest : PageRequest
    //{
    //    /// <summary>
    //    /// 课程编号
    //    /// </summary>
    //    public string? Code { get; set; }
    //    /// <summary>
    //    /// 课程名称
    //    /// </summary>
    //    public string? Name { get; set; }
    //    /// <summary>
    //    /// 备注
    //    /// </summary>
    //    public string? Remarks { get; set; }
        
    //}
    ///// <summary>
    ///// 学期分页请求参数
    ///// </summary>
    //public class TermPageRequest : PageRequest
    //{
    //    /// <summary>
    //    /// 学期名称
    //    /// </summary>
    //    public string? Name { get; set; }
    //    /// <summary>
    //    /// 简称
    //    /// </summary>
    //    public string? ShortName { get; set; }
    //    /// <summary>
    //    /// 备注
    //    /// </summary>
    //    public string? Remarks { get; set; }

    //}

    
}